package com.ssy.lingxi.contract.repository;

import com.ssy.lingxi.contract.entity.ApplyAmountOrderDetailDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 请款单明细
 * @author 伍将
 * @date 2021/3/10
 * @version 2.0.0
 */
public interface ApplyAmountOrderDetailRepository extends JpaRepository<ApplyAmountOrderDetailDO, Long>, JpaSpecificationExecutor<ApplyAmountOrderDetailDO> {

    /**
     * 根据情况单id进行请款单明细
     * @author 伍将
     * @date 2021/3/10
     * @param applyId: 情况单id
     * @return 无
     **/
    void deleteAllByApplyId(Long applyId);

    /**
     * 根据请款单id查询请款明细
     * @author 伍将
     * @date 2021/3/11
     * @param applyId: 请款单id
     * @return 请款明细
     **/
    List<ApplyAmountOrderDetailDO> findAllByApplyId(Long applyId);

    /**
     * 根据请款单id查询请款总单数
     * @author 伍将
     * @date 2021/3/24
     * @param applyId: 请款单id
     * @return 总单数
     **/
    Long countByApplyId(Long applyId);
}
